<?php
class Favo_model extends MY_Model {

    function __construct(){
        parent::__construct();
    }

    function get_favo_ids($loginer_id){
        $query = $this->db->from($this->tbl->favo.' f')
            ->select('f.tid')
            ->where(array('member_id'=>$loginer_id))
            ->get();
        $list = $query->result();
        $arr_id = array();
        if(!empty($list) && is_array($list)){
            foreach ($list as $k=>$v){
                $arr_id[] = $v->tid; 
            }
        }
        
        return $arr_id;
    }

    function get_favoer($tid){
        $query = $this->db->from('favo f')
            ->select('f.*,m.*')
            ->join('member m','m.id=f.member_id','left')
            ->where(array('f.tid'=>$tid))
            ->get();
        $list = $query->result();
        return $list;
    } 
        
    
}